<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script type="text/javascript">

    function setIdNo(){
        getBaseinfo('idNo','age');
        getBirthday('idNo','birthdayDate')
    }

    $(function(){
        setIdNo();
        var date = new Date().Format("yyyy-MM-dd");
        $("#hospitalizedDate").val(date);
        $("#attackdate").val(date);
    })


    $(function () {
        var clinicId = $("#clinicIdVal").val();
        $("#saveBtn").on('click', function () {
            if ($('#inputForm').parsley().validate()) {
                $.ajax({
                    type: "POST",
                    data: $("#inputForm").serialize(),
                    url: "${ctx}/doctor/patVisitIndex/updateInfo",
                    dataType: "json",
                    success: function (data) {
                        toastr.success(data.data);
                    },
                    error: function (data) {
                        toastr.error('网络连接错误,请检查网络');
                    }
                });
            }
            return false;
        })
    })

</script>

<div class="panel-body" style="padding-top:10px;background-color: white;">
    <div class="col-lg-12">
        <form:form id="inputForm" modelAttribute="patVisitIndex" method="post" class="form-horizontal">
            <input type="hidden" name="id" value="${patVisitIndex.id}">
            <input type="hidden" name="visitId" value="${patVisitIndex.visitId}">
            <%--<input type="hidden" name="patVisit.id" value="${patVisitIndex.patVisit.id}">--%>

            <div class="col-lg-12">
                <div class="opertion_items">
                    <div>基本信息</div>
                </div>
                <fieldset>
                    <div class="col-lg-4">
                        <div class="form-group">
                            <label class="col-sm-5 control-label">姓名：</label>

                            <div class="col-sm-7">
                                <label class="usual_label"><input name="name" htmlEscape="false" maxlength="50"
                                                                       class="form-control" readonly="true"
                                                                       data-parsley-required="true" value="${patVisitIndex.name}"/></label>
                                <%--<input type="hidden" name="name" value="${patVisitIndex.name}">--%>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">出生日期：</label>

                            <div class="col-sm-7">
                                <input type="text" name="birthdayDate" id="birthdayDate"
                                       value="<fmt:formatDate value="${patVisitIndex.birthdayDate}" pattern="yyyy-MM-dd" type="date" dateStyle="long" />"
                                       onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" readonly="true"
                                       class="form-control Wdate">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">民族：</label>

                            <div class="col-sm-7">
                                <sys:select checkValue="${patVisitIndex.nation}" readonly="true"
                                            lists="${fns:getDictList('NATION_DICT')}" className="form-control"
                                            name="nation"></sys:select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">国籍：</label>
                            <div class="col-sm-4">
                            </div>
                            <div class="col-sm-7">
                                <sys:select name="nationality" checkValue="${liveRequisition.nationality}" readonly="true" lists="${fns:getDictList('NATIONALITY_DICT')}" className="form-control"></sys:select>
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-sm-5 control-label">出生地：</label>

                            <div class="col-sm-7">
                                <input type="text" name="homeplace" value="${patVisitIndex.homeplace}" readonly="true"
                                       class="form-control">
                            </div>
                        </div>
                    </div>


                    <div class="col-lg-4">
                        <div class="form-group">
                            <label class="col-sm-5 control-label">性别：</label>

                            <div class="col-sm-7">
                                    <%--<label  class="usual_label">${fns:getDictLabels(patVisitIndex.sex,'SEX_DICT','')}</label>--%>
                                    <%--<input type="hidden" name="sex" value="${patVisitIndex.sex}">--%>
                                <sys:select checkValue="${patVisitIndex.sex}" readonly="true" lists="${fns:getDictList('SEX_DICT')}"
                                            className="form-control" name="sex"></sys:select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">身份证号：</label>

                            <div class="col-sm-7">
                                <input type="text" data-parsley-checkidcard="3" id="idNo"
                                       maxlength="100" name="idNo" onchange="setIdNo()" readonly="true"
                                       value="${patVisitIndex.idNo}" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">婚姻：</label>

                            <div class="col-sm-7">
                                <sys:select checkValue="${patVisitIndex.marriage}" readonly="true"
                                            lists="${fns:getDictList('MARRIAGE_DICT')}" className="form-control"
                                            name="marriage"></sys:select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">籍贯：</label>

                            <div class="col-sm-7">
                                <input type="text" name="nativePlace" value="${patVisitIndex.nativePlace}" readonly="true"
                                       class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">现住址：</label>

                            <div class="col-sm-7">
                                <input type="text" name="address" value="${patVisitIndex.address}"  readonly="true" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-4">
                        <div class="form-group">
                            <label class="col-sm-5 control-label">年龄(岁)：</label>

                            <div class="col-sm-7">
                                <input type="text" name="age" id="age" value="${patVisitIndex.age}" readonly="true"
                                       class="form-control">
                                    <%--<label class="usual_label">${patVisitIndex.age}岁</label>--%>
                                    <%--<input type="hidden" name="age" id="age" value="${patVisitIndex.age}">--%>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">工作单位：</label>

                            <div class="col-sm-7">
                                <input type="text" name="unitInContract" value="${patVisitIndex.unitInContract}" readonly="true"
                                       class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">职业：</label>

                            <div class="col-sm-7">
                                <sys:select checkValue="${patVisitIndex.identity}" readonly="true"
                                            lists="${fns:getDictList('PROFESSION_DICT')}" className="form-control"
                                            name="occupation"></sys:select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">体重：</label>

                            <div class="col-sm-5">
                                <input type="text" name="weight"
                                       data-parsley-validate="true" value="${patVisitIndex.weight}" readonly="true"
                                       class="form-control">
                            </div>
                            <label class="col-sm-2">kg</label>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">电话：</label>

                            <div class="col-sm-7">
                                <input type="text" name="phone" data-parsley-mobilephone="ture" readonly="true"
                                       data-parsley-validate="true" value="${patVisitIndex.phone}" class="form-control">
                            </div>
                        </div>
                    </div>
                </fieldset>
                <div class="opertion_items">
                    <div>入院信息</div>
                </div>
                <fieldset>
                    <div class="col-lg-4">
                        <div class="form-group">
                            <label class="col-sm-5 control-label">入院日期：</label>
                            <%--<input type="hidden" id="dischargeDate" name="patVisit.admissionDate" value="${patVisitIndex.patVisit.admissionDate}">--%>

                            <div class="col-sm-7">
                                <input type="text" id="hospitalizedDate" data-parsley-required="true"
                                       name="patVisit.admissionDate" readonly="true"
                                       value="<fmt:formatDate value="${patVisitIndex.patVisit.admissionDate}" pattern="yyyy-MM-dd" type="date" dateStyle="long" />"
                                       onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"
                                       class="form-control Wdate">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">发病日期：</label>
                            <%--<input type="hidden" id="situationDate" name="patVisit.situationDate" value="${patVisitIndex.patVisit.situationDate}">--%>
                            <div class="col-sm-7">
                                <input type="text" id="attackdate" data-parsley-required="true" name="patVisit.situationDate" readonly="true"
                                       value="<fmt:formatDate value="${patVisitIndex.patVisit.situationDate}" pattern="yyyy-MM-dd" type="date" dateStyle="long" />"
                                       onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"
                                       class="form-control Wdate">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">联系人：</label>

                            <div class="col-sm-7">
                                <input type="text" name="contacts" value="${patVisitIndex.contacts}" readonly="true"
                                       class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-4">
                        <div class="form-group">
                            <label class="col-sm-5 control-label">入院科室：</label>

                            <div class="col-sm-7">
                                <input type="hidden" name="patVisit.deptAdmissionTo" value="${patVisitIndex.patVisit.deptAdmissionTo}">
                                <input type="text" class="form-control" readonly="true"
                                       value="${fns:getDeptName(patVisitIndex.patVisit.deptAdmissionTo,'')}">
                                    <%--<sys:treeselect isnull="true" id="orgDeptId" name="hospitalizedDept"--%>
                                    <%--value="${liveRequisition.hospitalizedDept}" update="false"--%>
                                    <%--labelName="${liveRequisition.hospitalizedDept}"--%>
                                    <%--labelValue="${fns:getDeptName(liveRequisition.hospitalizedDept,'')}"--%>
                                    <%--title="科室" url="/sys/orgDept/treeData?clinicAttrs=0"--%>
                                    <%--extId="${orgDept.id}" cssClass="form-control" selectedParent="true"--%>
                                    <%--method="isNoFuChanKe"/>--%>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">隔离情况：</label>
                            <%--<input type="hidden" name="patVisit.quarantine" value="${patVisitIndex.patVisit.quarantine}">--%>
                            <div class="col-sm-7">
                                <sys:select checkValue="${patVisitIndex.patVisit.quarantine}" name="patVisit.quarantine"
                                            lists="${fns:getDictList('QUARANTINE_DICT')}" readonly="true"
                                            className="form-control"></sys:select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">关系：</label>

                            <div class="col-sm-7">
                                <sys:select checkValue="${patVisitIndex.contactsRelation}" name="contactsRelation"
                                            lists="${fns:getDictList('RELATIONSHIP_DICT')}" readonly="true"
                                            className="form-control"></sys:select>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-4">
                        <div class="form-group">
                            <label class="col-sm-5 control-label">入院情况：</label>
                            <%--<input type="hidden" name="patVisit.hospitalSituation" value="${patVisitIndex.patVisit.hospitalSituation}">--%>
                            <div class="col-sm-7">
                                <sys:select checkValue="${patVisitIndex.patVisit.hospitalSituation}" name="patVisit.hospitalSituation"
                                            lists="${fns:getDictList('ADMISSION_SITUATION_DICT')}" readonly="true"
                                            className="form-control"></sys:select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">入院病区：</label>
                            <input type="hidden" name="patVisit.wardAdmissionTo" value="${patVisitIndex.patVisit.wardAdmissionTo}">
                            <div class="col-sm-7">
                                <input type="hidden" value="${patVisitIndex.patVisit.wardAdmissionTo}">
                                <input type="text" class="form-control" readonly="true"
                                       value="${fns:getDeptName(patVisitIndex.patVisit.wardAdmissionTo,'')}">
                                    <%--<sys:treeselect selectedParent="true" id="wardAdmissionTo" name="wardAdmissionTo"--%>
                                    <%--value="${liveRequisition.wardAdmissionTo}"--%>
                                    <%--update="false"--%>
                                    <%--labelName="${liveRequisition.inDeptWord.id}"--%>
                                    <%--labelValue="${liveRequisition.inDeptWord.deptName}"--%>
                                    <%--title="科室" url="/sys/orgDept/treeData?clinicAttrs=2" isnull="true"--%>
                                    <%--extId="${orgDept.id}" cssClass="form-control"/>--%>
                                    <%--</div>--%>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">联系人电话：</label>

                            <div class="col-sm-7">
                                <input type="text" data-parsley-mobilephone="ture" data-parsley-validate="true"
                                       name="contactsPhone" value="${patVisitIndex.contactsPhone}" readonly="true"
                                       class="form-control">
                            </div>
                        </div>
                    </div>

                </fieldset>
                <div class="opertion_items">
                    <div>其他信息</div>
                </div>
                <fieldset>
                    <div class="col-lg-8">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">户口地址：</label>

                            <div class="col-sm-7">
                                <input type="text" name="diagnosisDesc" value="${patVisitIndex.contactsAddress}"
                                       readonly="true" readonly="true"
                                       class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">联系人地址：</label>

                            <div class="col-sm-7">
                                <input type="text" name="contactsAddress" value="${patVisitIndex.contactsAddress}" readonly="true"
                                       class="form-control">
                            </div>
                        </div>
                    </div>
                        <%--<div class="col-lg-4">--%>
                        <%--<div class="form-group">--%>
                        <%--<label class="col-sm-5 control-label">建议预交金：</label>--%>
                        <%--<div class="col-sm-7">--%>
                        <%--<input type="number" min="0" value="${liveRequisition.paymentAdvice}" name="paymentAdvice" class="form-control" maxlength="100"--%>
                        <%--data-parsley-required="true" >--%>
                        <%--</div>--%>
                        <%--</div>--%>
                        <%--</div>--%>
                </fieldset>
            </div>
            <%--<div class="form-group">--%>
            <%--<label class="col-sm-4 control-label">姓名：</label>--%>

            <%--<div class="col-sm-5">--%>
            <%--<form:input path="name" htmlEscape="false" maxlength="50" class="form-control"--%>
            <%--data-parsley-required="true"/>--%>
            <%--</div>--%>
            <%--</div>--%>
            <%--<div class="form-group">--%>
            <%--<label class="col-sm-4 control-label">性别：</label>--%>

            <%--<div class="col-sm-5">--%>
            <%--<form:select path="sex" class="form-control" data-parsley-required="true">--%>
            <%--<form:option value="" label=""/>--%>
            <%--<form:options items="${fns:getDictList('SEX_DICT')}" itemLabel="label" itemValue="value"--%>
            <%--htmlEscape="false"/>--%>
            <%--</form:select>--%>
            <%--</div>--%>
            <%--</div>--%>
            <%--<div class="form-group">--%>
            <%--<label class="col-sm-4 control-label">年龄：</label>--%>

            <%--<div class="col-sm-5">--%>
            <%--<form:input path="age" id="age" htmlEscape="false" maxlength="50" class="form-control"--%>
            <%--data-parsley-required="true"/>--%>
            <%--</div>--%>
            <%--</div>--%>
            <%--<div class="form-group">--%>
            <%--<label class="col-sm-4 control-label">费别：</label>--%>

            <%--<div class="col-sm-5">--%>
            <%--<form:select path="chargeType" class="form-control" data-parsley-required="true">--%>
            <%--<form:option value="" label="----请选择----" selected="selected"/>--%>
            <%--<form:options items="${fns:getDictList('CHARGE_TYPE_DICT')}" itemLabel="label" itemValue="value"--%>
            <%--htmlEscape="false"/>--%>
            <%--</form:select>--%>
            <%--</div>--%>
            <%--</div>--%>
            <%--<div class="form-group">--%>
            <%--<label class="col-sm-4 control-label">身份：</label>--%>

            <%--<div class="col-sm-5">--%>
            <%--<form:select path="identity" class="form-control">--%>
            <%--<form:options items="${fns:getDictList('PROFESSION_DICT')}" itemLabel="label" itemValue="value"--%>
            <%--htmlEscape="false"/>--%>
            <%--</form:select>--%>
            <%--</div>--%>
            <%--&lt;%&ndash;<div class="col-sm-5">&ndash;%&gt;--%>
            <%--&lt;%&ndash;<form:input path="identity" htmlEscape="false" maxlength="50" class="form-co ntrol" data-parsley-required="true" />&ndash;%&gt;--%>
            <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
            <%--</div>--%>
            <%--<div class="form-group">--%>
            <%--<label class="col-sm-4 control-label">身份证号：</label>--%>

            <%--<div class="col-sm-5">--%>
            <%--<form:input path="idNo" id="idNo" class="form-control"--%>
            <%--data-parsley-checkidcard="3" maxlength="100" onchange="getBaseinfo('idNo','age')"--%>
            <%--onblur="return validPersonInfoUnique('idCard','idCard','personId','${ctx}/sys/sysLoginName/validateUnique');"/>--%>
            <%--</div>--%>
            <%--</div>--%>
            <%--<div class="form-group">--%>
            <%--<label class="col-sm-4 control-label">合同单位：</label>--%>

            <%--<div class="col-sm-5">--%>
            <%--<form:input path="unitInContract" htmlEscape="false" maxlength="50" class="form-control"/>--%>
            <%--</div>--%>
            <%--</div>--%>
            <%--<div class="form-group">--%>
            <%--<label class="col-sm-4 control-label">住址：</label>--%>

            <%--<div class="col-sm-5">--%>
            <%--<form:input path="address" htmlEscape="false" maxlength="50" class="form-control"/>--%>
            <%--</div>--%>
            <%--</div>--%>
            <div class="form-group">
                <label class="col-sm-4 control-label"></label>

                <div class="col-sm-5">
                    <%--<input id="saveBtn" class="btn btn-primary" type="button" value="保 存"/>--%>
                </div>
            </div>
        </form:form>
    </div>
</div>
